﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace Main.utils
{
    [ValueConversion(typeof(int),typeof(bool))]
    public class ToDoTaskStatusConvertor : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if(value is int status)
            {

                return status == 2;
            }
            throw new ArgumentException();
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is bool val) {

                return val ? 2 : 1;
            }


            throw new ArgumentException();
        }
    }
}
